<template>
  <div>
    <div>爷爷的钱:{{ money }}</div>
    <SonCom @abc="abc" :nameList="nameList1" :list="nameList2" v-bind="{ x: 100, y: 100 }" />
    <MittTest />
    <ModelValueTest />
    <TestComRef />
  </div>
</template>
<script setup lang="ts">
import { provide, reactive, ref } from 'vue'
import SonCom from './SonCom.vue'
import MittTest from './MittTest.vue'
import type { Person } from '@/types'
import ModelValueTest from './ModelValueTest.vue'
import TestComRef from '../TestComRef.vue'

const nameList1 = reactive<Array<Person>>([{ name: '小刚', age: 19 }])
const nameList2 = reactive<Person[]>([{ name: '小明', age: 19 }])
const abc = (val: any) => {
  console.log('触发自定义时间 参数', val)
}
const money = ref(100)
const updateMoney = () => {
  money.value += 1
}
provide('dollar', { money, updateMoney })
</script>

<style lang="scss" scoped></style>
